<template>
  <nav class="navbar">
    <div class="nav-brand">开发小工具</div>
    <ul class="nav-menu">
      <li class="nav-item">
        <router-link to="/generator" class="nav-link" :class="{ active: $route.name === 'generator' }">
          <el-icon><DataAnalysis /></el-icon>
          <span>数据生成</span>
        </router-link>
      </li>
      <li class="nav-item">
        <router-link to="/processor" class="nav-link">
          <el-icon><Operation /></el-icon>
          <span>数据处理</span>
        </router-link>
      </li>
      <li class="nav-item">
        <a href="#" class="nav-link">
          <el-icon><User /></el-icon>
          <span>个人信息</span>
        </a>
      </li>
    </ul>
  </nav>
</template>

<script setup>
import { House, DataAnalysis, Operation, User } from '@element-plus/icons-vue'
</script>

<style scoped>
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #2A5C9A;
  color: white;
  padding: 0 24px;
  height: 60px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.nav-brand {
  font-size: 20px;
  font-weight: bold;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 24px;
}

.nav-item {
  display: flex;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 4px;
  transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}
</style>